package org.headquarter.gui;

import org.boxlayout.gui.BoxLayoutEngine;
import org.boxlayout.gui.VisualElement;
import org.boxlayout.gui.layout.LayoutFactory;
import org.boxlayout.gui.layout.FlowLayout.FlowDirection;
import org.boxlayout.gui.type.ColorEnum;
import org.headquarter.object.Place;

public class WidgetPlace extends WidgetNode{

    
    VisualElement nameContainer;
    
    public Place getPlace() {
        return (Place)node;
    }
    
   
    
    void updateVisual(){
	nameContainer.setText(getPlace().getName().getValue());
    }
    
    public WidgetPlace(BoxLayoutEngine ble) {
	super(ble);
	visual
	.setAlpha(0.0f)
	.setLayout(LayoutFactory.getInstance().getVerticalLayout())
	;
	
	VisualElement nameContainerBorder = ble.createElement()
	.setColor(ColorEnum.WHITE)
	.setRounded(true)
	.setRoundRayon(0.1f)
	.setPadding(0.03f)
	.setLayout(LayoutFactory.getInstance().getVerticalLayout())
	;
	
	nameContainer = ble.createElement()
	.setColor(ColorEnum.BLACK)
	.setTextColor(ColorEnum.WHITE)
	.setRounded(true)
	.setRoundRayon(0.1f)
	.setPadding(0.04f)
	;
	
	
	
	childContainer = ble.createElement()
	.setAlpha(0.0f)
	.setPaddingLeft(0.2f)
	.setPaddingTop(0.1f)
	.setLayout(LayoutFactory.getInstance().getVerticalLayout())
	.setEnable(false)
	;
	
	nameContainerBorder.add(nameContainer);
	visual.add(nameContainerBorder);
	visual.add(childContainer);
	
    }
    
    

}
